import axios from '@/libs/api.request'

export const getTableData = () => {
  return axios.request({
    url: 'get_table_data',
    method: 'get'
  })
}

export const getDragList = () => {
  return axios.request({
    url: 'get_drag_list',
    method: 'get'
  })
}

export const errorReq = () => {
  return axios.request({
    url: 'error_url',
    method: 'post'
  })
}

export const saveErrorLogger = info => {
  return axios.request({
    url: 'save_error_logger',
    data: info,
    method: 'post'
  })
}

export const getUserData = param => {
  return axios.request({
    url: 'get_table_data',
    method: 'get',
    params: { param }
  })
}
// 获取选择用户的信息
export const getUserdetail = param => {
  return axios.request({
    url: '/apidl/user/detial',
    method: 'post',
    data: param
  })
}
// 获取通道信息
export const getPassagewayData = param => {
  return axios.request({
    url: '/apidl/user/balance',
    method: 'post',
    data: param
  })
}

export const getflowinfo = param => {
  return axios.request({
    url: '/apidl/aiorder/planlist',
    method: 'post',
    data: param
  })
}

export const getConsumptionFlow = param => {
  return axios.request({
    url: '/apidl/aiorder/ailist',
    method: 'post',
    data: param
  })
}

// 订单异常处理
export const ExceptionHandling = param => {
  return axios.request({
    url: '/apidl/aiorder/errororder',
    method: 'post',
    data: param
  })
}

export const getRepayFlow = param => {
  return axios.request({
    url: 'getRepayFlow',
    method: 'get'
  })
}
// 获取用户列表
export const getUserlist = param => {
  return axios.request({
    url: '/apidl/user/ulist',
    method: 'post',
    data: param
  })
}

// 用户升级vip
export const upvip = param => {
  return axios.request({
    url: '/apidl/user/upvip',
    method: 'post',
    data: param
  })
}

// 统计报表数据
export const Statics = param => {
  return axios.request({
    url: '/apidl/aireport/imcome',
    method: 'post',
    data: param
  })
}

// 修改密码
export const modifyPassword = param => {
  return axios.request({
    url: '/apidl/base/setInfo',
    method: 'post',
    data: param
  })
}

// 获取配置信息
export const getConfig = param => {
  return axios.request({
    url: '/apidl/aiconfig/getconfig',
    method: 'get',
    params: param
  })
}

export const setConfig = param => {
  return axios.request({
    url: '/apidl/aiconfig/editconfig',
    method: 'post',
    data: param
  })
}

// 图片上传api
export const uploadImgApi = param => {
  return axios.request({
    url: '/apidl/aiconfig/pic',
    method: 'post',
    data: param
  })
}

export const repaybank = param => {
  return axios.request({
    url: '/apidl/aiconfig/planbank',
    method: 'get',
    params: param
  })
}
